<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="app" uri="http://www.wanrenhui.com" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
	  <%@include file="/res/include/base-head.jsp"%>
	  <%@include file="/res/include/jquery-easyui.jsp"%>
	<script type="text/javascript" src="${pageContext.request.contextPath}/res/js/user/userWithdraw.js"></script>
  </head>
  <body>
	<div class="easyui-layout" data-options="fit:true">
	<div data-options="region:'north',border:false,split:false">
	    	<form id="query-form" class="search_form clearfix">
            	<dl>
					<dt>用户呢称：</dt>
					<dd>
						<input name="userNick" id="userNick" type="text" class="txt" maxlength="64"/>
					</dd>
				</dl>
	            <dl>
	                <dt>银行类型：</dt>
	                <dd>
	                	<select name="type" id="type" class="txt grid-8">
	                		<option value="">--请选择--</option>
	                		<option value="1">支付宝</option>
	                		<option value="2">银行卡</option>
	                		<!-- <option value="3">微信</option> -->
	                	</select>
	                </dd>
	            </dl>
	            <dl>
	                <dt>提现状态：</dt>
	                <dd>
	                	<select name="status" id="status" class="txt grid-8">
	                		<option value="">--请选择--</option>
	                		<option value="1">申请中</option>
	                		<option value="2">确认提现</option>
	                		<option value="3">确认收款</option>
	                		<option value="4">已驳回</option>
	                	</select>
	                </dd>
	            </dl>
	            <dl>
	            	<dt>申请提现时间：从</dt>
	                <dd>
		                <input name="startAtStr" id="startAtStr" type="text" class="txt easyui-datetimebox" maxlength="19"/> 到 
		                <input name="endAtStr" id="endAtStr" type="text" class="txt easyui-datetimebox" maxlength="19"/>
	                </dd>
	            </dl>
	            <p class="search_form_btn">
	            	<input type="button" value="搜索" class="icon_serach" onclick="admin.userWithdraw.query()" />
	            </p>
	            <dl></dl>
	            <p class="search_form_btn">
	            	<input type="button" value="导出excel" class="icon_serach" onclick="admin.userWithdraw.export2Excel()" />
	            </p>
	        </form>
	  		<form id="show-form" class="search_form clearfix">
		  		<dl>
					<dt>提现总额（元）：</dt>
					<dd>${allSum}</dd>
				</dl>
				<dl>
					<dt>本年提现总额（元）：</dt>
					<dd>${yearSum}</dd>
				</dl>
				<dl>
					<dt>本月提现总额（元）：</dt>
					<dd>${mothSum}</dd>
				</dl>
			</form>
	  	</div>
	    <div data-options="region:'center',border:false">
		    <table id="datagrid" data-options="url:'${pageContext.request.contextPath}/user/withdraw/list',toolbar:'#toolbar'">
				<thead>
					<tr>
						<th data-options="field:'flowId',width:100,align:'center'">流水号</th>
						<th data-options="field:'nick',width:100,align:'center'">用户</th>
						<th data-options="field:'cash',width:100,align:'center'">金额</th>
						<th data-options="field:'typeDesc',width:100,align:'center'">银行类型</th>
						<th data-options="field:'accountNo',width:200,align:'center' ">银行卡号或支付宝账户</th>
						<th data-options="field:'userReal',width:120,align:'center'">开户人姓名</th>
						<th data-options="field:'bankName',width:300,align:'center'">用户开户行名称</th>
						<th data-options="field:'statusDesc',width:100,align:'center'">提现申请状态</th>
						<th data-options="field:'strNewAt',width:120,align:'center'">申请提现时间</th>
						<th data-options="field:'strStatusAt',width:120,align:'center'">操作时间</th>
						<th data-options="field:'remark',width:120,align:'center'">驳回备注</th>
			            <th data-options="field:'id',align:'center',width:250,formatter:formatOperation">操作</th>
					</tr>
				</thead>
			</table>
	  	</div>
	</div>

	<script>
	function formatOperation(value,row,index) {
		var l_html = '';
		var status=row.status;
		var id=row.id;
		var userId=row.userId;
		l_html+='<a href="javascript:void(0)" class="table_link" onclick="admin.userWithdraw.moneyLog('+userId+')">查看流水</a>';
		if(status==1){
			l_html+='<a href="javascript:void(0)" class="table_link" onclick="admin.userWithdraw.paying('+id+')">确认提现</a>';
			l_html+='<a href="javascript:void(0)" class="table_link" onclick="admin.userWithdraw.cancle('+id+')">驳回</a>';
		}
		if(status==2){
			l_html+='<a href="javascript:void(0)" class="table_link" onclick="admin.userWithdraw.confirm('+id+')">确认收款</a>';
		}
		return l_html;
	}
	</script>
  </body>
</html>
